#include<bits/stdc++.h>
using namespace std;


/**
 * 
 * 时间复杂度：O(n)
 * 空间复杂度: O(1)
 * 
 * 区间和
 * 
 */
int main() {
    int s[125];
    int n, l, r;
    cin >> n;
    for (int i = 0;i < n; i++) {
        cin >> s[i];
    }
    cin>> l >> r;
    int sum = 0;
    for (int j = l - 1; j <= r - 1; j++) {
        sum += s[j];
    }
    cout << sum;
    return 0;
}